<?php
/**
* @package Scribble
*/
use Buan\Config;

$dateTimeFormat = Config::get('ext.Scribble.dateTimeFormat');
$urlRoot = Config::get('ext.Scribble.urlRoot');
ScribbleAdminView::getGlobalView()->addStylesheets("{$urlRoot}/css/scribble/page/comments.css");
ScribbleAdminView::getGlobalView()->addJavascripts("{$urlRoot}/js/scribble/page/comments.js");
?>

<div class="head">
	<h1>Page Comments</h1>
</div>

<table class="list">
	<thead>
		<tr>
			<th class="col-date">Date posted</th>
			<th class="col-comment">Comment &amp; author</th>
			<th class="col-status">Status</th>
		</tr>
	</thead>

	<tbody>
	<?php foreach($comments as $c): ?>
		<tr>
			<td class="col-date"><?php $this->html->e(date($dateTimeFormat, $c->datecreated)); ?></td>
			<td class="col-comment">
				<span>
					<b><?php $this->html->e($c->authorname); ?></b> &#160; (<?php $this->html->e($c->authoremail); ?>)
					<?php if($c->authorwww!=''): ?>
						&#160; (<a href="<?php $this->html->e($c->authorwww); ?>" rel="external"><?php $this->html->e($c->authorwww); ?></a>)
					<?php endif; ?>
				</span>
				<p><?php $this->html->e(substr($c->body, 0, 150)); ?> ... <a href="#" rel="readfulltext">read more</a></p>
				<div class="fulltext">
					<?php echo $c->getBodyHtml(); ?>
				</div>
			</td>
			<td class="col-status">
				<a href=""><span>Toggle moderated status</span></a> |
				<a href=""><span>Delete</span></a> |
				<a href=""><span>Reply</span></a>
			</td>
		</tr>
	<?php endforeach; ?>
	</tbody>
</table>